package com.aigou.admin.aigouspringboot.controller.user;

import com.aigou.admin.aigouspringboot.common.LogScope;
import com.aigou.admin.aigouspringboot.entity.ProductType;
import com.aigou.admin.aigouspringboot.result.Result;
import com.aigou.admin.aigouspringboot.service.ProductTypeService;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Mr.LiFuXing
 * @Date 2024/12/10 20:22
 * @Title UserController
 * @Package com.aigou.admin.aigouspringboot.controller
 */


@RestController("userProductType")
@RequestMapping("/user/ProductType")
@Slf4j
public class ProductTypeController {

    @Resource
    private ProductTypeService productTypeService;

    /**
     * 分页查询
     *
     * @param current 当前页
     * @return info
     */
    @GetMapping
    @LogScope(title = "用户管理模块", content = "查看用户列表信息")
    public Result select(@RequestParam Integer current) {

        log.info("查询第{}页的用户信息", current);
        // 分页查询 都返回PageInfo(分页插件工具)
        PageInfo<ProductType> userPageInfo = productTypeService.selectProductTypeListByPage(current);
        return Result.success(userPageInfo);
    }



}
